package kr.hkit.androidcomplete02.alarm;

import android.app.Activity;
import android.content.Context;
import android.media.AudioManager;
import android.os.Bundle;

public class AudioManagerEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
		am.getRingerMode();
		if(am.getRingerMode() == am.RINGER_MODE_NORMAL){
			am.setRingerMode(am.RINGER_MODE_VIBRATE);
			finish();
		}else if(am.getRingerMode() == am.RINGER_MODE_SILENT){
			am.setRingerMode(am.RINGER_MODE_VIBRATE);
			finish();
		}else{
			finish();
		}
	}
}
